Skip to content

Pass IPAM options when creating networks#13936

Open
ousamabenyounes wants to merge 3 commits into
docker:mainfrom
ousamabenyounes:fix/issue-13785
Open

Pass IPAM options when creating networks#13936
ousamabenyounes wants to merge 3 commits into
docker:mainfrom
ousamabenyounes:fix/issue-13785

Conversation

@ousamabenyounes

@ousamabenyounes ousamabenyounes commented Jul 11, 2026

Copy link
Copy Markdown

Summary

  • Pass Compose networks.*.ipam.options through to Docker network creation.
  • Add regression coverage for IPAM options without an IPAM driver or pool config.

Fixes #13785

Test verification (RED -> GREEN)

  • Baseline: make test initially reported DONE 497 tests, 2 skipped, 1 failure; the pre-existing failure was pkg/watch TestGitBranchSwitch.
  • RED: with only pkg/compose/create.go reverted, TestExecutePlanCreateNetworkWithIPAMOptions failed because opts.IPAM was nil instead of containing Options: {"ipam-option": "enabled"}.
  • GREEN: go test ./pkg/compose -run TestExecutePlanCreateNetworkWithIPAMOptions -count=1 -v passed.

Full local suite

  • Command: make test
  • Result: passed with DONE 499 tests, 2 skipped after rebasing on latest main.

@ousamabenyounes
ousamabenyounes requested review from a team as code owners July 11, 2026 08:23

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few changes to improve readability and avoid confusion between the two IPAM definition blocks.

Comment thread pkg/compose/create.go Outdated
Comment thread pkg/compose/executor_test.go
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
@ousamabenyounes

ousamabenyounes commented Jul 16, 2026

Copy link
Copy Markdown
Author

Addressed the review feedback in 7d1e1078e:

  • built the IPAM object once in resolveOrCreateNetwork, including driver, config, and options, and removed the redundant second block
  • made the executor network test constants shared across the sibling tests
  • changed the IPAM option assertion values to ipam-option=enabled so they no longer collide with the project name

Rebased on latest docker:main and reran:

  • go test ./pkg/compose -run 'TestExecutePlan(Empty|CreateNetwork|CreateNetworkWithIPAMOptions)$' -count=1
  • make test -> DONE 499 tests, 2 skipped

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Network's IPAM options not working

2 participants